﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using ZoneLine.Models;

namespace ZoneLine.Views.converts
{
    public class ModelConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (Enum.TryParse(value?.ToString(), out ModelEnum model))
            {
                switch (model)
                {
                    case ModelEnum.LX:
                        return "理想";
                    case ModelEnum.SQ:
                        return "上汽";
                    case ModelEnum.BQKH:
                        return "北汽空簧";
                    case ModelEnum.BQLH:
                        return "北汽空簧";
                    case ModelEnum.WL:
                        return "蔚来";
                    default:
                        break;
                }
            }
            return "未知型号";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
